Application of programmable logic control in the nonlinear machine automation control using numerical control technology

: To explore the application of programmable logic control ( PLC ) in the automatic control of nonlinear machine tools, the application of PLC in the nonlinear electronic system control is studied. First, the author takes PLC technology in the numerical control machine tool electrical control application as the research equip - ment, PLC technology in the numerical control machine tool electrical control application is divided into four types.Then,accordingtotheneedofmanagementnumber, the overall structure of PLC is designed and developed, and the concept of operation modularization is adopted to rea - lize the decentralized development of PLC. There are three functional modules: repair, compile, and simulate. Finally, the machining performance of the nc system is evaluated experimentally. The processing time di ﬀ erence of two kinds ofmachinetoolsiscompared.Theaverageprocessingtimeof theoriginal ( Numericallycontrolled ) NCsystemis3.06 s,and theaverageprocessingtimeoftheembeddedsoftPLCsystem is 2.01 s, with a gap of 1.04 s between the two systems. The ComputerNumericalControl ( CNC ) machiningimprovement of 1 s is signi ﬁ cant in the processing e ﬃ ciency of CNC machine tools. The numerical control system embedded in thePLCsystemismorestableinthemachiningtime,soitcan be concluded that the numerical control - embedded soft PLC system has carried on some improvements and upgrades to the operation of machine tools. PLC has relatively strong reliability, stability, and ﬂ exibility and is widely used in industrial control systems. In the production process of CNC machine tools, the application of PLC can improve the automatic control level of machine tools. The application of PLCcanimprovetheautomaticcontrollevelofmachinetools


Introduction
Programmable logic control (PLC) means programmable memory, and it only knows the operation logic, time, temporary control, counting operation, and other functions of the memory, as well as the real-time automatic control of the digital system ( Figure 1). PLC is mainly for the computer control industry, with the same function as other computers such as input/output, power module, central processing unit (CPU) module, memory module, and function module. Compared with other computers, PLC technology output is easier to maintain, more flexible, and easier to operate [1].
PLC technology output has more convenient functions, and it is more easy to receive and use for users. Generally, graphics and graphic design are the main design, and computer programming knowledge is not required. Therefore, the construction cost of the PLC technology is lower, and the use of field debugging operation is easier. When the user's purpose function changes and information needs to be modified, it does not need to decompose tools and hardware to modify the function. The modification can be completed through online update service, which improves efficiency. The operation instructions are changed. In addition, PLC technology can be combined with Internet technology to achieve the purpose of centralized control and improve the performance and efficiency, reliability of technology, strong anti-interference, and stable operation. Based on the aforementioned performance, PLC technology has been widely used in the control of performance equipment and achieved remarkable results. The application of PLC technology in the electronic control of Computer Numerical Control (CNC) machine tools can improve the accuracy of CNC machine tools and lay a foundation for the development of the technology [2]. Therefore, it is of great significance to study the application of PLC technology in the electrical control of CNC machine tools.
PLC technology is a modern control system, has a good application in the electrical control of machine tools, and promoted the development of CNC machine tools in our country. So far, PLC technology is mainly used for electrical control of CNC machine tools, and it is independent and built in two ways. PLC independent technology application is wide and PLC technology output can help customers. It provides better performance, and choosing the best PLC output technology can achieve good electrical control of CNC machine tools. Built-in PLC technology is the combination of PLC technology, and the technology includes NC technology, PLC technology, and NC technology to complete the signal transmission; can support fast data exchange based on the internal bus; and improves data scalability. In addition, PLC technology and NC technology can be used alone or by CPU sharing to improve the security of control. The most important goal of technology management is to achieve the goal of effective management in the process through the exchange of digital information and the modern application of technology [3]. Therefore, PLC technology in the application of numerical control machine control, with the aid of the data exchange function of the equipment, can complete the data exchange of numerical control machine, numerical control processing machine, and PLC machine to improve performance to achieve the ultimate control of electrical equipment in CNC machine tools. In addition, in the process of data exchange, not only it is limited to the data exchange between two or more sites but also it can identify the data exchange attributes between CNC machining and CNC machine tools. To ensure the accuracy and safety of all kinds of data exchange, different models of CNC machine tools using different combinations can improve the efficiency of data exchange, from the Input/ output (I/O) terminal board to understand the purpose of data management. From CNC machine tools to the ultimate programmable control, the communication mode of the interface can be customized by users according to their own needs, which effectively improves the practicability of the fire protection lightning control system in digital technology.

Literature review
Yao and Cao found that the domestic PLC programming environment, the ladder diagram editing, and the instruction list editing environment are relatively independent and cannot be programmed in a coordinated manner, unifying the ladder diagram and the instruction list. The programmer must learn and memorize the ladder diagram instructions when writing the ladder diagram, which consumes more time and hence greatly reduces efficiency [4]. Nwoguh et al. believed that the editing efficiency of ladder logic programs is low, the repeatability is high, and it is difficult to modify ladder diagrams; when modifying, the ladder diagram needs to be re-edited, the repeatability of the program is relatively poor, and the operator is very inconvenient to use [5]. Gong et al. found that the editing interface of the program lacks humanized operation and necessary textual instructions and necessary information prompts, which is troublesome to operate [6]. Takanashi et al. found that the soft PLC technology originated abroad, and therefore, their soft PLC technology leads the domestic development in foreign countries, the application of soft PLC in various industries has been rapidly developed, and this technology has been applied in some CNC machining equipment. Its market share grows exponentially every year [7]. Alghamdi et al. showed the importance and rapid development of PLC since its inception in the control industry. PLC has been the main battlefield in the field of industrial automation for a variety of automation control tools to provide a very reliable control concept. PLC, distributed control system (DCS), and industrial PC (IPC) developed as the tripartite composite [8]. Jia and Wu discussed the future development of the printing industry at home and abroad, which is similar, that is, to develop in the direction of fast, high precision, good aperture, fine metal, fine sound, high reliability, multilayer, and high reliabilityspeed transmission, lightweight, thin shape, and at the same time in production towards improving productivity, reducing costs, reducing pollution, adapting to more uses, and small batch production direction [9]. Wen et al. showed that the development and independence of the intelligent control system are also weak, but most of them are based on the secondary development codes of foreign products. The study also focuses on the study of foreign advanced construction machinery controller, research, and development of domestic crane controller, to solve the localization of crane controller, to provide software and hardware technical support for the development of new crane controller, and to break the monopoly of controllers in the market [10].
On the basis of the current research, to explore the application of PLC in the automatic controlling of nonlinear machine tools, we study the application of PLC in the controlling of nonlinear electronic systems. It can be seen from the experimental results that the CNC system embedded in the PLC system is more stable in the processing time, and the CNC system embedded in the CNC soft PLC system has improved and upgraded the machine tool operation to some extent. PLC has strong reliability, stability, and flexibility, and is widely used in industrial control systems.

The working principle of PLC
PLC is a programmable logic control device. Because of its strong data processing ability, fast counting speed, accurate logic and sequence control, and also with functions such as positioning communication, in today's CNC automation field, PLC has become one of the pillars in the field of industrial control. The early machine tool system did not have a module mounted on the PLC control unit, and the control function of the machine tool could only be solidified on the operation panel of the numerical control system. Such a CNC system is relatively old fashioned, and its flexibility and real-time operability are relatively poor, once the processing control instructions are formulated, they cannot be modified, they can only passively complete the specified processing actions and cannot add other functions. The rapid development of the 3 C industry urges the CNC industry to continue to update and develop, and high-quality products make customers have higher and higher expectations for CNC machine tools. The traditional CNC system has been unable to meet the processing requirements of customers. Therefore, the performance of CNC machine tools should be improved, and the improved CNC system not only has innovations and breakthrough points but also has improved functions and ensures that the machine tool is flexible and convenient in operation and has strong real-time processing [11].
The control functions performed by individual PLCS in drawing and NUMERICAL control systems are the same. They only complete the transformation of electrical equipment except control equipment and PLC between the CNC system and the machine tool, and complete the control process of each function of the machine tool. In the operation of CNC machine tools, the CNC system usually completes the operation of machine tools, screw thread machining control and scheduling, process control, and other processes. During the operation of the CNC machine tool, PLC and CNC system complete their functions separately, integrate and exchange the data of the machine tool, and then complete the logic control and operation of the machine tool [12]. The operation of the CNC soft PLC system adopts scanning mode, and the operation process of the soft PLC system is divided into three stages: stage input, process completion, and output control stage.
Sampling input stage: Collect the status data of the scene input and the module and transmit it to the input image.
Program execution stage: The PLC logic control program written by the user executes the user program according to the principle of PLC ladder diagram execution, first up, then down, first left, and then right. The processed data in the input image area are stored to prepare for the next system call or directly as the control output of the machine tool.
Output control phase: After the user program scan is completed, the scan output service has been started, and the data register extracts the state data in the output image, transmits it to the output template for conversion, and sends the successfully converted template to the relevant execution file on the control site [13].
The scanning process is shown in Figure 2:

CNC soft PLC system architecture established
The working principle of the soft PLC is the same as that of the traditional PLC, and the function of the logic control is the same [14], but the soft PLC is embedded in the numerical control system and runs on the operating system. In the system with embedded PLC, the realization of the soft PLC system functions depends on data input and output, and the data transmission of the soft PLC system is mainly through the I/O module of the machine tool or the physical device such as the field bus. In the development of the system, the soft PLC system architecture is divided into two parts: the development system and the operation system. Development system: The development system must have certain development and design functions, which mainly include editing, compiling, and simulation [15]. Together they form the editing and development environment for PLC logic programs.
Running system: The running system completes the work of input processing, program execution, and output processing, is a complete PLC control unit core, and belongs to the PLC core control part.
In the soft PLC system, the development system and the operation system are two independent systems; in the soft PLC system, work can be relatively independent of each other. These two independent systems run, respectively, in the user control (mainly the development interface control module of the host computer) and the kernel space (the computer memory space occupied by the developed soft PLC kernel), and it communicates through shared memory (the data storage exchange space between the development system and the running system). Its overall structure is shown in Figure 3.
The development system of soft PLC provides logic program editing, compiling, and simulation. In the compilation module of the development system, after the program compilation is completed, the software PLC operating system converts the compiled PLC logic program into a system-identifiable decoding file. The compilation module can detect the syntax and logic errors of the logic program while compiling the logic program [16].
The development of the soft PLC operating system is developed and designed according to the functional layered development mode. The operating system mainly includes the management layer of the soft PLC, the virtual machine layer, the hardware abstraction layer, and the memory management layer. The soft PLC operating system is responsible for interpreting and translating the loaded target file, and sending the translated code to the numerical control system to control the mechanical actuator. The external ID system is accessed through the hardware abstraction layer. In CNC machining operations, when the user requests to execute the object code generated by the development system. first, the virtual machine of the soft PLC system allocates memory space and loads the target code into the allocated memory space, and then the virtual machine loads and executes the object code. The functions of the management layer of the running system realize the communication with the soft PLC development system, analyze the PLC object file code loaded by the virtual machine, and control the running and stopping of the PLC system. The function of the hardware abstraction layer is communication, which establishes a complete set of hardware interfaces between the CNC system and the machine tool and avoids direct access to external ports by upper-level software. The memory management layer is to complete the program scheduling and memory allocation of the system [17].

The architecture design of Soft PLC in numerical control system
It can be seen from the analysis in the previous section that the soft PLC is a virtual logic control unit, a virtual control kernel written in a high-level language, the development system, and the operation system jointly support the work of the soft PLC system. During the operation of the soft PLC system, the two parts of the system can be regarded as two black boxes, the two black boxes complete logical control through communication and data transmission, the communication between the two parts is mainly carried out by the target code, and the object code is the only bridge between the development system and the runtime system and the only way to communicate with each other [18]. Figure 4 shows the overall organizational structure diagram of the soft PLC system. The soft PLC development system should be able to meet the openness and expansibility of the system, and the storage of system data and the interactive display of the interface should be relatively independent of each other and reduce the degree of coincidence between system design architectures. Therefore, the design framework of the soft PLC development system adopts a layered design method. The system mainly has three core layers: data storage layer, view layer, and control layer. The functions of each layer of the soft PLC designed this time are divided as follows: 1) Data storage layer: The system's logic ladder diagram program editing is to connect the relevant ladder diagram primitives in an orderly manner according to a certain logic, and a graphics program with certain functions is formed. The soft PLC system regards the primitives of the ladder diagram as a solid component model. Each model component represents an electrical device. The primitive models of these entities are connected by energy streamlines, and a ladder diagram program with certain network information and electrical properties is formed [19]. 2) View layer: It converts the graphics edited by the user into instructions or converts the instructions into graphics and transmit them to each control module, and displays the ladder diagram of the data storage layer. It plays the role of the human eye to a certain extent to control input and feedback. The main function of the view layer is to display the stored graphic elements of the data layer in the editing interface. 3) Control layer: The control layer is to effectively classify and encapsulate the functional modules of the soft PLC, and the control layer plays the role of human bones in the application of the system.  The soft PLC development system designed and developed this time encapsulates a total of three functional modules: edit module, compile module, and simulate module. a) The task of the editing module is to provide users with the functions of editing and modifying logic programs. This module is the basis for the design and implementation of the software PLC system compilation and simulation module. b) The compilation module is mainly responsible for compiling the ladder diagram program edited by the editing module. The ladder diagram program is compiled into the target code that the running system can recognize. The running system decodes it, and the numerical control system calls the decoding of the running system and then completes the logic control task of the numerical control system [20]. c) The simulation module is a logic simulation test for the ladder diagram program, and logical errors that can cause machine failures should be avoided.

Application of PLC in CNC machine tool automation
In the running process of modern CNC machine tools, PLC has a very complete self-diagnosis function, especially the application of automation technology, which provides a solid foundation for the self-diagnosis of machine tools. When the CNC machine tool has a fault during the working process, the system will immediately identify the fault and issue an alarm message, the alarm information will be displayed on the CRT in time, and at this time, operators and maintenance personnel can accurately find and analyze the cause of the fault through the displayed various information and eliminate the fault in time, which provides a good foundation for the system generation. In the operation process of CNC machine tools, there are very clear action sequences, which can be automatically exchanged according to these sequences, and the application of PLC in the fault diagnosis process of CNC machine tools is judged by the sequence characteristics of mechanical movements. After the collector resistance R c increases, the voltage magnification ratio A ul increases, and the inverse relationship between the output and the input does not change.
R p is adjusted to an appropriate value, and consider U i = 5 mV, f = 1 kHz, and access R L = 2.4k, that is, pull up, measure U O , and observe the output waveform. It can be seen through the oscilloscope that the output waveform is not distorted, and the output voltage U o is 0.729 V measured with an AC millivolt meter. Under the condition that R p is a suitable value, it is obvious that the output voltage of R L = 2.4k is smaller than that of R L that is not connected. (1) It can be seen that after the collector resistance is reduced, the amplification factor of the voltage after the load is reduced than A u1 , and the inverse relationship between the output and the input does not change.
Toggle the switch so that the R c = 2k, RL = ∞, or S1 boards are to the right, and the S2 boards are downward. Then, R p is adjusted to an appropriate value, namely, U c = 5 V, and the two boards with β = 95 and β = 90 are compared. It can be seen through the oscilloscope that the output waveform of β = 95 is not distorted, and the output voltage U O measured with an AC millivolt meter is 1.276 V, which is larger than the output voltage of β = 90.
The T function refers to the function of selecting tools in the production process of CNC machine tools, different components require different tools, and the scientific and reasonable selection of tools can also be performed automatically through PLC. When the tool needs to be replaced, the system will issue an instruction, and the programmable controller receives the code instruction output from the system that the tool needs to be replaced, starts to translate the instruction, and then performs data analysis. We can find the number corresponding to the tool that needs to be replaced, and the found tool is then compared with the tool required for the production [21]. If it does not match, an instruction to change the tool will be issued until the required tool is finally selected. The specific control process is to first connect the soft switch of the PLC input to make the motor rotate to the corresponding position and then select and change the tool. At this time, the motor is reversed, and the tool holder is pressed down after it has fallen. After the tool change is over, the system will send a signal that production can continue.

Experimental analysis
Numerical control machine tool performance measurement is an important index to measure the advantages and disadvantages of the numerical control system. In the machining industry, the standard for measuring the performance of CNC systems, i.e., the performance of the system, is evaluated according to the performance of machine tools and equipment. Because this design is intended to improve the machine's performance, this performance metric depends on the machine's processing time to complete the machine's trial run [22].
Under the existing actual test conditions in the workshop (the CNC machine tools in the workshop are limited, and a large number of tests cannot be performed), two machine tools of the same type and model are selected (one of the two machine tools is an unupgraded CNC system, and the other is a numerical control system with the embedded soft PLC system). The performance tests of CNC machine tools are carried out on these two machines. The test method is to select a machining path, processing is performed on two machine tools at the same time, and by recording the processing time of the two machine tools, two sets of processing time data are obtained. The obtained data are analyzed and processed. By comparing the mean and variance of the two groups of data, we can judge the pros and cons of the machining performance of the machine tool, so as to evaluate the pros and cons of the numerical control system [23].
Through the actual machining operations in the workshop, ten sets of machining data were obtained on the two machine tools. The selection of processing data is universal and random. Both machine tools are processed 20 times, and ten groups of data are randomly selected from the processed data for analysis and comparison. The obtained data are presented in Tables 1 and 2, and the unit of time data in the tables is presented in seconds (s): According to the comparison of Figure 5 presented in Tables 1 and 2, it can be seen that the two CNC systems before and after the upgrade are under the same processing conditions. There is a certain gap in the time used to process the same path, the average processing time of the original CNC system is 3.06 s, the average processing time of the CNC system with the embedded soft PLC system is 2.01 s, and there is a gap of 1.04 s between the two systems. The improvement of 1 s in CNC machining is a great improvement for the processing efficiency of CNC machine tools. Moreover, by comparing the variance of the machining time of the two machine tools, the CNC system embedded with the soft PLC system is much more stable in terms of machining time. It can be concluded that the numerical control system embedded with the soft PLC system has improved the machining performance of the machine tool to a certain extent [24].
The introduction and application of the soft PLC system relieve the burden of the numerical control NC to a certain extent, the electrical equipment is controlled by the soft PLC, and the numerical control system focuses on the processing of tools and paths. Judging from the results, this system upgrade has achieved the expected purpose, it not only realizes the control of electrical equipment by CNC soft PLC but also reduces the processing time of the machine tool and improves the processing efficiency [25][26][27][28][29].

Conclusion
To explore the application of PLC in the automatic control of nonlinear machine tools, the application of PLC in the controlling of nonlinear electronic systems is studied. The reliability, stability, and flexibility of PLC are relatively strong, and it is widely used in industrial control systems. In the production process of CNC machine tools, the application of PLC can improve the automation control level of machine tools. It can realize effective control of each link in the production process of CNC machine tools, such as   starting and stopping programs, automatic tool change in the production process, automatic diagnosis, and treatment of various faults in the production process. All can be realized through the application of PLC technology. Under the same processing conditions and paths, there is a certain difference in the time taken by the two CNC systems before and after upgrading. The average processing time of the original CNC system is 3.06 s and that of the embedded soft PLC system and CNC system is 2.01 s. There is a gap between the two systems. The CNC machining time is reduced by about 1 s, and the machining efficiency of the CNC machine tool is significantly improved. In short, the PLC logic layer realizes the planning and design of the control system in software and hardware, which is a more advanced machine tool system. Future CNC machine tools need to set up a more specialized platform in operation and need to establish a more systematic and complete solution, and at the same time, it is necessary to combine the logic layer of PLC to select some feasible numbers and technologies as support, so as to explore a more intelligent design scheme. In future research, the remote diagnosis function is developed for the machine tool, that is, the industrial computer is connected to the Internet, and the manufacturer can remotely diagnose and analyze the status of the machine tool. By modularizing each part of the machine tool, some functions can be summarized and tested, and when the machine tool is upgraded in the future, the machine tool can be quickly upgraded by adding modules.