Design and implementation of embedded PLC
Module composition of embedded PLC
The PLC control module of the CNC system has high real-time requirements and must be operated in the real-time domain of the system. According to the PLC control of the universal numerical control system and the modular design of the numerical control system software, the PLC control module of the numerical control system is one of the real-time tasks of the RT-Linux system. The priority and calling cycle depend on the real-time performance of each task of the numerical control system. Requirements and response time for control requirements. The PLC control module mainly completes the logic control of the numerical control system, and the input and output of the controlled I/O is completed by the I/O interface card input and output module of the PC, that is, the PLC control of the numerical control system requires two RTs. - Linux real-time tasks, as shown in Figure 3, these two tasks are RT-Task1 (hereinafter referred to as "adaptor card input and output"), RT-Task2 (hereinafter referred to as "PLC control").
Figure 3 is a real-time task relationship diagram of embedded PLC based on RT-Linux system. The input and output of the adapter card is mainly to complete the input and output of the CNC system, that is, the output of each axis position control command, I/O output, I/O. Input and position feedback input, which is actually the device driver module of the CNC system control card, its priority is the highest level among the real-time tasks of the CNC system. According to its hardware characteristics and motion control requirements, its response period is 100μs, and the response clock period is generated by the hardware timer on the PC I/O interface card. According to the response mechanism of the RT-Linux system to the hardware interrupt, the real-time performance of the input and output control tasks can be guaranteed, which has been verified in our numerical control system.
The PLC control in Fig. 3 mainly completes the PLC control function of the numerical control system, and its task priority is lower than the input and output of the adapter card, and also lower than the fine interpolation real-time task and the position servo real-time task of the numerical control system. According to the PLC control requirements of the general CNC system, the response period is determined to be 5ms, and the response period is generated by the RT-Linux software timer. According to the real-time multi-task scheduling mechanism of the RT-Linux system, the real-time performance of the PLC control task can be guaranteed. . It has also been verified in practical applications.
Real-time task module data communication of embedded PLC
The amount of data required to input and output between the two real-time tasks controlled by the PLC of the CNC system (in general, 64 input, 64 output, but the input and output can be expanded as needed) is not too large, so the communication method using shared memory is adopted. , in the adapter card input and output and PLC control
Two shared memories are opened between two real-time tasks, one for the adapter card to transfer the I/O port status information to the PLC control, and the other for the PLC control to the adapter card input and output task transmission after the PLC logic processing information.
Here, the reason why the two real-time tasks do not use RT-FIFO for communication is that the amount of data communication between the two real-time tasks is not very large, and the two real-time tasks have different running cycles, and the data is transmitted by RT-FIFO. In order to avoid FIFO blocking, correspondingly to increase the coordination mechanism between the two tasks, such communication effect is not necessarily better than using shared memory, and the shared memory read and write speed is relatively faster than the FIFO.
Real-time task realization of embedded PLC
The input and output of the adapter card is a dynamic loadable module, and the hardware input and output module (task) of the adapter card is interrupted by hardware with a period of 100μs. The position control command and I/O output of each axis, the position feedback value of each axis and I/ are completed. The input of O, the output value of the adapter comes from the position servo task and the PLC control task, and the input value comes from the input interface of the adapter card. The PLC control module (task) is also a dynamic loadable module that periodically reads control information (such as M command, S command and T command) from the RT-FIFO that communicates with the master control module with a soft timing of 5ms. At the same time, I/O information is read from the shared memory that communicates with the adapter card input/output module, and then logical processing is performed. Finally, the result is written into the shared memory for the adapter card input/output module to read and output.
in conclusion
At present, the embedded PLC module has been successfully applied to the THHP-III CNC system (based on RedHatLinux8.0+RTLinux3.1) of the Institute of Manufacturing Engineering of Tsinghua University. This module can meet the PLC control requirements for common CNC systems and machining centers. .
Previous page
Rock Wool Strip Core Color Steel Plate
Yu Ou Nuo Rock Wool Cored Color Steel Plate and its production process realize the combination of rock wool and steel plate into a whole through automatic equipment in the factory, thus changing the previous production way that rock wool plate needs to be compounded on site. On the premise of meeting the requirements of building thermal insulation, sound insulation and fire prevention, it achieves the goal of high quality, high efficiency, reliability and safety. The product has been widely used in Europe and has been mature and perfect.
Rock Wool Sandwich Color Steel Plate,Rock Wool Cored Color Steel Plate,Waterproof Rock Wool Cored Steel Panel,Rock Wool Colored Steel Board
Zhengzhou Ou Nuo Building Materials Co., Ltd. , https://www.yuounuo.com