MFG Guide

Multi-task real-time control of open CNC system based on Windows NT

With the rapid development of computer and communication technology, in the field of industrial control, the research and application of open CNC systems is an inevitable trend. The first item of the eighth item “manufacturing” in the current guidelines (catalog) for key areas of high-tech industrialization that the State Development Commission and the Ministry of Science and Technology issued on July 14, 1999 is: applicable and advanced cnc machine tools And the open numerical control system (the 112th sub-item in total) shows that the country attaches great importance to the research and development of open numerical control system, because it is directly related to the competitiveness of my country’s manufacturing field, and in turn determines whether the entire industrial foundation is solid. The open number system with its excellent characteristics of interoperability, portability, interchangeability and scalability, facilitates the system integration of various control requirements and the use of end users.

In the research of open CNC system, it is feasible to use software to realize the core functions of the control system. The high real-time nature of the control system puts forward special requirements on the operating system. This article will analyze the selection of the operating system platform of the full-software open CNC system and give specific application implementation.

1 The real-time nature of the numerical control system requires the current numerical control system structure, whether it is a dedicated system or a PC-based machine, and is limited by computer performance and operating system, it adopts a software and hardware combination system structure.

The dedicated closed control system corresponding to the open control system still occupies a considerable part of the market, including various CNC devices of FANUC, AB and SIEMENS. The hardware structure and control software of these control systems are all dedicated designs. In order to meet the high requirements of real-time interpolation operation and position control, they are either implemented by dedicated hardware or served by multiple CPUs. The PC-based CNC system has benefited from the openness of the PC to a certain degree. The system is built on a general operating system. The main operating system platform is Wimows+DOS, because the current Windows products do not support real-time requirements. The scheduling and management of high real-time tasks can only be used for man-machine interfaces and tasks with weak real-time performance, while position control and interpolation calculations are completed through hardware plug-ins.

Because the CNC hardware is generally designed for special purposes, the flexibility is poor, which restricts the opening pace of the CNC system. On the contrary, the all-software control system has the characteristics of convenience and flexibility. It makes full use of popular operating system platforms as support, standard application development environment, and has good interoperability, portability, interchangeability and scalability. Open performance. Compared with the traditional PC-based structure, the all-software CNC system must solve the software problems of interpolation calculation and position control. The support of the selected operating system for strong real-time functions has become the key to all-software CNC.

CNC system functions can be divided into strong real-time, weak real-time and non-real-time according to real-time. The so-called strong real-time means that the system must end the processing of the control task within a given time frame, otherwise the consequences will be disastrous. Weak real-time means that if the system cannot fully guarantee to respond to the control requirements within the allowed time, it can respond later. Non-real-time has no strict requirements on system response time. For example, the interpolation operation is 2ms for rough interpolation, and the position control is for 1ms sampling. If the scheduling management of the operating system cannot respond to them in time, intermittent processing will occur. Although decoding, tool compensation and speed calculation are closely related to interpolation, they often wait for interpolation during automatic processing, so they are weak real-time tasks. The display update in the man-machine interface generally takes human visual factors into consideration, and is set to be more than 100ms, which is a non-real-time task.

2 Analysis of the real-time performance of the operating system When using an operating system in an open control system, the application scope of the operating system must first be considered, and the second is the degree of support for real-time tasks.

The so-called openness means being widely used and accepted. In the past real-time control systems, most of them used dedicated real-time operating systems such as VxWorks, RTOS and QNX, which did not meet the open trend and requirements. At present, Microsoft’s Wm(i)ws and various versions of Unix (except Linux) are widely used, but the various versions of these operating systems cannot fully support real-time control, which constitutes two contradictory aspects.

and other characteristics are widely used in industrial control, but only in control systems with weak real-time requirements. For the Windows system, it itself is a message-driven real-time multitasking operating system implemented by intercepting the 08H interrupt of DOS. In the messages of Widows, the clock message WM-TIMER is considered to be a less important message. The message queue is always ranked after *, and when there are multiple WM-TIMER messages in the message queue, the Wid (ws system itself will Combine all WM-TMER messages into one WM-TIMER message. Simply relying on the clock message of the Windows system itself cannot fully meet the requirements of the control system. In other systems above 5, the system itself has implemented shielding of the hardware. Direct access to the hardware in the program will produce an abnormal structure. This means that in the application under the Wimbws platform, direct access to the hardware is not feasible, and the required clock accuracy cannot be obtained.

Remodeled and introduced WindowsCE based on real-time control. Among them, the interrupt response speed of WindowsCE3.0 can reach 50us, which can fully meet the requirements of hard real-time, but its biggest disadvantage is that it only supports 1/3 of Win32API and cannot meet the GUI and network requirements. Therefore, it cannot be fully qualified for real-time control. In addition, Linux, which has been discussed a lot at present, is also a hope as a real-time control operating system platform. The New Mexico University of Mining and Technology developed Real-TimeLinux (RT-Linux), but it also has the following shortcomings: security cannot be fully guaranteed; all of the above shortcomings limit the application of Linux in real-time control systems, but with Linux research As the operating system platform of the real-time control system continues to expand, it is still very promising.

Mature. The application of WindowsNT’s real-time expansion system is indeed a good development direction. Many third-party software vendors have developed corresponding real-time extensions for Windows NT, such as Intime from RadSys and RTX from Ven-tuCom. Their solutions are to use Win-d (wsNT to achieve weak real-time control tasks, make full use of NT’s powerful graphical interface development functions, network and security advantages, etc., while real-time tasks rely on real-time expansion to achieve.

3 Application realization on the WindowsNT+ real-time expansion platform We believe that the development of a full-software open control system should adopt a software structure that combines front-end and back-end with multiple interrupts. The front and back control system structure is suitable for a single machine environment, and multiple interrupts are suitable for a distributed control environment.

But in most front-end and back-end structures, there is often only one timing interrupt for real-time tasks, that is, interpolation, position control, and PLC are all completed in a timing cycle. This processing cannot effectively use system resources and improve system performance. This system is designed to run in a stand-alone environment. It adopts a front-end and back-end structure. Three real-time timing interrupts are set for position control, interpolation calculation and PLC. The priority is increased and the interrupt cycle is decreased, which can achieve reasonable utilization of resources and improve system performance. Purpose.

The main function of the real-time extension of WindowsNT is to expand the real-time function and task priority of NT, and the scheduling management of the real-time expansion takes over the scheduling management of NT. At the same time, a series of real-time control functions are added, including: timer, interrupt, Physical memory management, I/O operation and signal lights, etc.

The full software CNC system function is divided into two parts: Win32 process and real-time extended process. The Win32 process is responsible for low real-time tasks such as man-machine interface, diagnosis, and interpolation preparation; the real-time expansion process is responsible for strong real-time tasks such as position control, interpolation calculation, and PLC. They communicate through the shared memory mechanism provided by real-time expansion, see.

The interrupt response speed of strong real-time tasks is the key to the full software open CNC system. The real-time performance of the system must be tested, which is the 3) test of the full software CNC system structure. The running time is 1 hour. It can be seen that the cumulative *latency is 25.9. The interrupt response speed is related to the main frequency of the computer, so the value with low main frequency is larger, and the value with high main frequency is smaller. The test results show that they can meet the requirements of strong real-time tasks.

4 Conclusion The all-software control system based on popular operating systems has good openness, and gets rid of the shackles of dedicated hardware architecture and dedicated operating systems, and brings convenience to end users in maintenance, use and system upgrades.

Please keep the source and address of this article for reprinting:Multi-task real-time control of open CNC system based on Windows NT

Reprint Statement: If there are no special instructions, all articles on this site are original. Please indicate the source for reprinting.:Cnc Machine Wiki,Thanks