The most popular open laser cutting machine based

  • Detail

Research on Open CNC system of laser cutting machine based on Windows CE


windows CE is an open and scalable 32-bit embedded operating system developed by Microsoft. Different from Windows 95/98 and WindowsNT, Windows CE is an embedded new operating system with all source codes developed by Microsoft. Although its operating interface comes from Windows 95/98, Windows CE is a new information equipment platform based on Win32. Today, Jinan hengsi Shanda focuses on introducing the protection method of hydraulic jaw of tensile testing machine API, which is re developed. Windows CE has the characteristics of modularity, structure, Win32 based application program interface and processor independence [1]. Microsoft introduced a new generation of Windows CE in 2002 Net, its performance has been further improved. It supports Bluetooth technology, TCP/IPv6, and has been successfully applied in the field of real-time multi task control [2]. Relative to DOS, windows ce Net is a multithreaded 32-bit operating system running in protected mode, which is especially suitable for the multitask parallel mechanism of CNC system, and its memory protection function is of great significance to the stability of CNC system: compared with Windows desktop operating system, windows ce Net is an embedded real-time operating system. Its unique architecture and operating mechanism enable it to quickly respond to external interrupt triggers and schedule related applications for processing [3], so it can meet the real-time requirements of CNC system. Win2dows CE. Net is a real-time operating system, which provides important technologies required for real-time development, including:

(1) 256 level thread priority provides greater flexibility for controlling

thread timing in embedded systems

(2) interrupt nesting allows higher priority interrupts to be executed immediately without waiting for the execution of lower priority interrupt service programs. The kernel can nest all the interrupt service programs supported by the CPU

(3) the time slice of each thread allows the application to set the time slice on the principle of multithreading, which means that the scheduler can adapt to the current requirements of the application

(4) priority inversion means that when two threads compete for the same resource, the resource is occupied by the low priority thread and the execution of the high priority thread is delayed. To correct this situation and free the high priority thread, Windows CE allows the low priority thread to inherit the more urgent thread priority and run at a higher priority until it releases the resources it occupies

ndows CE system development platform customization

in order to enable users to easily turn Windows CE to a new hardware platform, Microsoft provides a complete development tool P latformbuilder 4 2. It includes some necessary tools so that developers can create platform specific software development kits (SDKs) for componentized operating system versions. The platform wizard allows developers to easily and quickly establish a new platform according to the type of device to be created. See Figure 1

figure 1windows CE system platform customization diagram

to create a platform based on windows ce Net operating system platform must go through the following steps: ① select a standard development board (SDB) to create the Windows CE platform. ② Customize the platform using the optional devices in the platform wizard and the features listed in the catalog. ③ Build and generate the image file (im2age). ④ Download the platform to the target device and debug the platform. ⑤ After the platform is created, output the software development kit (SDK)

when customizing the platform, users can develop their own OEM hardware adaptation layer (oal). Oal is the connection layer between the Windows CE system kernel and the target device hardware, which is used to abstract hardware functions and realize the portability of the operating system. The OEM hardware adaptation layer is divided into two parts: the OEM abstraction layer and the device driver

the hardware development platform is a target device used to simulate embedded system devices, which can be used to develop, debug and verify the performance of customized platforms. Plat2form builder supports PC based hardware development platform (cepc). Cepc is the most flexible Windows CE device and is very suitable for the development and debugging stage of embedded systems

2. Overall design and implementation of CNC system of open laser cutting machine

2.1 composition of CNC laser cutting machine

Figure 2 Schematic diagram of laser processing system

CNC laser cutting machine is composed of laser cutting machine host, CO2 laser, water cooler, external light path system, CNC system and automatic programming software [4] (see Figure 2). The laser and the external light path system are the key components of the numerical control laser cutting machine. Their performance indicators will directly affect the cutting quality of laser cutting plates, and the host of the laser cutting machine is the carrier to achieve high-quality laser cutting. Therefore, it is particularly important to develop and design the host computer of numerical control laser cutting machine

2.2 analysis and construction of open CNC system based on industrial PC

with the development of computer technology in recent years, industrial PC and modular integrated circuit have gradually entered the CNC field. PC has become the basis of open CNC system with its unique openness. It enriches the hardware and software resources of CNC system and is conducive to the realization of bus, modular and open CNC system, The system uses the popular operating system platform as the support, adopts the standard application development environment, has good interoperability, portability, interchangeability and scalability, shows good open performance, and has the characteristics of convenience and flexibility. At the same time, the powerful graphical interface function, multi thread mechanism and multimedia timer of Windows CE are fully used to solve the real-time multi task processing ability of NC software. Its good software and hardware compatibility can realize the modular open NC system based on the standard bus. The open CNC system can adopt a layered architecture, as shown in Figure 3. Each layer is isolated, and the communication between layers is carried out through standard interfaces. The layered architecture of the open control system is realized, which makes the NC software easy to assemble, expand and maintain. The first level is the management level. It is the interface part of the system, which can complete the management, display, diagnosis and monitoring of the system. Switch between different interfaces by responding to different messages generated by the state selection control, and its calling operation is managed by the operating system

the second layer is the functional unit layer. It is the control part of the system, including code generation, compilation and interpretation, interpolation operation and motion control, i/o processing and data acquisition. It is a relatively independent functional unit. A large amount of data is exchanged between them through multiple data buffers established in the software. The decoding can interpret the NC instructions into the internal data format of the system, and the interpolation operation completes the data interpolation to generate processing data, speed processing and auxiliary function equipment control. The motion control program completes the control of position servo. The i/o signal processing module receives the input of various keys and converts them into program variables or system messages for operation. The data acquisition module is responsible for collecting the information and a/d signals of each moving axis to realize the functions of real-time data display and real-time control

the third layer is the support layer, including motion control card, device driver of motion controller, i/o card and industrial PC

2.3 hardware structure of open CNC system

Figure 4 shows the structure of open CNC system of laser cutting machine constructed by PMAC motion controller

Figure 4 control system diagram of laser cutting machine

3 Design and implementation of CNC system software

3.1 overall structure of CNC system software based on Windows CE

and we first pay attention to the material characteristics you need in product utilization. In the existing similar CNC systems, most of them are based on DOS environment, and their comprehensive performance is weaker than that of Windows environment, especially in terms of human-computer interface, multi task and openness. The real-time information exchange and communication between master and slave computers is the key to realize the coordination between upper and lower computers. This CNC system is similar to robot control in terms of real-time requirements. If timer, a special timer control in windows, is used, it is very convenient to use and can realize certain timing functions, but the minimum timing accuracy is only 55ms, and the priority of timer messages in the multi task operation system is very low, so it can not be responded in time and can not meet the application in the real-time control environment. Therefore, it is considered to use a multimedia timer with higher accuracy, which can achieve high-precision timing with an accuracy of 1ms, and can meet the real-time requirements of the system. The multimedia timer does not depend on the message mechanism. Instead, an independent thread is generated by the function timersetevent(). After a certain number of interrupts arrive, it directly calls the preset callback function for processing without waiting until the message queue of the application is empty. Therefore, the callback function is set to complete the periodic scanning of the input port of the i/o card and send messages to the system regularly to update the interface and the data in the interface in time. In order to improve the reliability of the system, the multimedia timer is started when the whole control program is initialized, and the timer is deleted when the system exits to release system resources. Every windows application is a process, and the thread is responsible for executing the code contained in the process address space. In fact, each process can have multiple threads that execute code "simultaneously" in the process's address space. The CNC system software adopts the multi thread structure of front and back platform. The foreground program is controlled by the main thread and timer of the system, which mainly completes interface management, function control, system management, etc., and is responsible for responding to the data input by the keys and interface, that is, realizing the functions of the management layer. The background program is placed in the auxiliary thread, which is responsible for compiling and processing the NC code, sending commands to PMAC and collecting real-time data, and realizing the functions of the control layer

3.2 implementation of G code conversion module

in order to make PMAC control card compatible with G code instructions, G code compilation and conversion module is specially developed, which greatly improves the openness and compatibility of the control system and provides convenience for users who are familiar with G code programming. This compilation module uses a multi-threaded method. The application of multithreading enables the parallel processing of programs, and multithreading enables different codes to be executed "at the same time". This module uses worker threads, which are suitable for processing background tasks without affecting users' use of applications. The worker thread is only implemented by a function body. Its implementation is simple and easy for the programmer to control. Combined with the event synchronization method, it can respond quickly to the abort messages in recent years. Event synchronization is to notify other threads that a certain operation has been completed or has not been completed by setting the event itself to signal or no signal. Its setting can be manually completed by programmers, which is suitable for industrial control program applications

correspondingly, this module has a main thread and two sub threads, one of which is a communication thread and the other is a computing thread. The main thread is provided by every application under windows. It is responsible for the synchronization between threads, passing parameters to computing threads and communication threads, managing human-computer interface, receiving user input and other functions. The communication thread is responsible for communicating and exchanging with the devices at the lower end through the communication port (PCI interface involved in this procedure)

Copyright © 2011 JIN SHI