国产日韩欧美一区二区三区三州_亚洲少妇熟女av_久久久久亚洲av国产精品_波多野结衣网站一区二区_亚洲欧美色片在线91_国产亚洲精品精品国产优播av_日本一区二区三区波多野结衣 _久久国产av不卡

?

Research and Design of Embedded Serial Device Server on the DNC System

2013-12-07 07:33:19QUBaojunGUOChao
機(jī)床與液壓 2013年1期
關(guān)鍵詞:山東理工大學(xué)多任務(wù)內(nèi)核

QU Baojun,GUO Chao

School of Mechanical Engineering, Shandong University of Technology, Zibo 255049, China

ResearchandDesignofEmbeddedSerialDeviceServerontheDNCSystem

QU Baojun*,GUO Chao

SchoolofMechanicalEngineering,ShandongUniversityofTechnology,Zibo255049,China

ThispaperdiscussedthesoftwareandhardwaredesignmethodsofEmbeddedSerialDeviceServerontheDNCSystem,andpresentedasortofruletotransmissionlineforNCprogramadaptedtoDNCsysteminthefaceofasetofquestionsaboutNCmachiningadoptedwithgeneralserialdeviceserver.IthasbeenresearchedindetailsaboutthearchitectureandkerneloftheEmbeddedSerialDeviceServerandputforwardthedetailmethodofachievingmultitaskkernel.

serialdeviceserver,DNCsystem,μC/OS-II,ethernet

With the development of computer technology, modern communication technology and advanced manufacturing technology, the DNC (distributed numerical control ) has become a typical form of workshop information integration, which uses a computer or network to achieve the integrated control on multiple CNC machine tools, including NC program transfer, machine condition monitoring, tool management, and production scheduling[1-3].

Serial device server is a protocol converter for RS232/RS485 and TCP/IP, which provides transparent data transfer between RS232/RS485 and the network. This paper mainly researched and developed the embedded serial device server dedicated to the DNC system.

1.The transmission mechanism of the serial server

DNC system can accomplish the transmission of manufacturing data and monitoring of machine condition, while the computer is the storage system of the manufacturing data and status information. Under the actual production conditions, the computer generally does not need real-time control on the CNC machine tool, just needs to monitor the running state of the machine tool. Only in the condition that the NC program is being transmitted while the workpiece is being machined, the DNC system is particularly strict with the real-time control. Thus, it requires the serial port server which connects to the CNC machine tools to maintain a certain amount of data buffering constantly. In the long workpiece process, whether the data can be received timely by machine or not relates to the amount of data buffering. If the data can not be received continuously, it will result in data underrun; If the amount of data buffering is too small, the data received will be lost, resulting in data overload. Therefore, only when the receiving speed and the sending speed of the serial server match, the data buffering can be maintained at a reasonable level. The mechanism of the data transmission is to establish reasonable rules for sending and receiving data, so as to control the amount of data buffering.

Therefore, as shown in Fig.1, the process that the NC program is sent to the CNC machine by DNC server can be divided into two stages.

First is that the NC program is sent from the DNC server to the serial device server, and then we must consider how to match the data transmission speed. The solution is to provide a data buffer queue in the serial server to decide whether to send the requested information by determining the size of the data queue. In accordance with the requirements of the NC machining, the maximum data buffering can be set to 10 KB. However, the agreed value of the data buffering is set to 5 KB. When the queue size is less than 5 KB, it will request the network to continue to send data.

Fig.1 The transmission procedure of the NC program sending line

Second is that the NC program is sent from the serial device server to the CNC machine, and then we must guarantee that the CNC machine can correctly receive data. The solution is to adopt handshake protocol for serial transmission between the serial device server and CNC machine.

When using the remote control to achieve that the CNC machines send the NC program containing command information to the DNC server, TCP is a reliable stream end-to-end protocol, and the network bandwidth is up to 10/100 Mbps, so the timeliness and definiteness of the NC program can be satisfied, and therefore the NC program can be transmitted directly. There is no need for data buffering. And M30 can be adopted as the end instruction of the program, indicating the end of a CNC file transmission.

2.The hardware structure of the serial device server

The essence of the serial device server is a converter of TCP/IP and RS232[4], its internal structure is shown in Fig.2. It accesses to the workshop LAN upward, adopting RJ-45 connector form, whose communication medium is a non-shielded twisted pair. It connects to the CNC machine having the RS232 serial port downward and serial device server can be installed as a part of the CNC machine on the CNC machine.

The serial server CPU adopts processor LPC2210, which is based on 16/32 bit ARM7TDMI RISC core. Then it uses LPC2210 and the network physical layer chip RTL8201BL as the core to complete the peripheral hardware circuit design work, which is used as a basis to select the hardware development platform.

LPC2210 itself doesn’t own FLASH, the system selects the 4Mbit FLASH (SST39VF160) to save the TCP/IP protocol stack and other programs, and selects the 16Mbit SRAM (IS61LV2561611L) as the memory to meet the requirements of the μC/OS-II embedded operating system and the memory block copy operation of the communication controller.

Fig.2 The hardware structure of the serial server

3.The software structure of the serial server

3.1.Multitaskingkerneldesignforserialservers

The serial server kernel is the key to realize DNC communication system based on Ethernet. It mainly have two functions: First, the serial server receives the NC programs sent by DNC servers from the network, meanwhile, it sends them to the CNC machine through the serial port; Second, the serial server receives the NC programs or the commands sent by the CNC machine from the serial port, meanwhile, it sends them to the DNC server over the network.

μC/OS-II is a priority-based preemptive multitasking real-time operating system. According to the requirements of the data transfer mechanism of the DNC system, this paper uses the μC/OS-II multitasking kernel to achieve the functions of the serial port server by assigning them to five tasks[5].

Among them, task 1 is used to receive data from the network; Task 2 is used to receive data from the CNC machine; Task 3 is used to send data to the network; Task 4 is used to send data to the CNC machine, and when the data transfer is completed, it will send a confirmation message to the task 5. Finally, task 5 judges whether confirmation message is received or not; If received, it requests the network to continue to send data. When the NC program is being transmitted when the workpiece is being machined, the requirements for real-time are strict. Therefore, as to the task priority, task 4 is set as the highest level, followed by task 1.

Shared variables and non-reentrant functions exist in each task, so semaphores in the μC/OS-II needs to be used to control the right of use of the shared resources, to mark the occurrence of a time, and to make the behaviors of the two tasks synchronous. Through the use of semaphores to promise multi-tasks to run, only the task having applied to the semaphore can run. When the serial server is multitasking running, semaphores used by it are as follows:

OS_EVENT *SerialRecvFlag;

/*Semaphore marking serial data is readable.*/

OS_EVENT *NetSendFlag;

/*Semaphore marking network can send data.*/

OS_EVENT *ShareVarbFlag;

/*Semaphore marking shared variables can be used.*/

OS_EVENT *ReqireSendFlag;

/*Semaphore marking request for sending data is available.*/

There are three steps in implementing the semaphores:

1.OSSemCreate(); /*Initialization*/

2.OSSemPend(); /*Waiting for signal*/

3.OSSemPost(); /*Sending signal*/

3.2.Thedesignofnetworkcommunicationprogramforserialserver

As the server-side of TCP/IP, serial server achieves the network connection with the DNC server. Through DNC server polling the serial port server, the NC programs or commands are transmitted between the client and the serial port server up and down. The data buffering adopts data queue to balance the problems of transmission speed matching between the serial server and the CNC machine. The correlation functions are as follows:

#define UART1_SEND_QUEUE_LENGTH 1024*10

/*The maximum data buffering is 10K*/

uint8 UART1SendBuf[(UART1_SEND_QUEUE_LENGTH + sizeof(int)-1)/ sizeof(int)];

QueueCreate((void*)UART1SendBuf,sizeof(UART1SendBuf), NULL, NULL)/*Creating a queue*/

QueueWrite((void *)UART1SendBuf, tempdata[i]);

/*Sending data into the queue*/

QueueRead(&temp,UART1SendBuf);

/*Acquiring data in the queue*/

The network communication program mainly completes the two tasks of receiving and outputting network data. The flow chart of the task of receiving network data is shown in Fig.3, the serial server receives data from the network, then processes data separately depending on the type of data.

3.3.Serialportcommunicationprogramdesignforserialserver

The serial communication of serial port server achieves the communication between the serial port server and the CNC machine, which completes the two tasks of receiving and outputting data of the serial port. Although there are many types of CNC machines, most of them support communication protocols of XON/XOFF and RTS/CTS, and serial device server supports these two communication protocols as well. The choices of the parameters related to communication, such as baud rate, parity, data bit and stop bit, are initialized in the network communication program.

Fig.3 The data flow diagram of the receiving network

4.Conclusions

This article developed a single serial port server based on the embedded system, which connects with the CNC machine FANUC0i downward, the DNC system upward. Through a series of tests, the result shown the rationality and applicability of the dedicated serial port server in the DNC system, especially in the demanding real-time process that the NC program is being transmitted as the workpiece is being machined, the machine downtime caused by data underload or overload doesn’t occur. However, in a long process, because the transmission speed does not match, the universal serial device server previously used often leads to the machine abnormity, and sometimes results in the automatic reset of the serial device server. So this article proves that the dedicated serial device server has a good real-time, stability and robustness.

[1] ZHANG Xumei,LIU Fei. Research of the workshop operation mode based on the integrated DNC technology[J]. Chinese Mechanical Engineering,1999,10(3):97-101.

[2] XIONG Bin. Theoretical discussion of the agile DNC system[J].Computer Integrated Manufacturing System,1999,5(6):1-6,25.

[3] Wainwright C R,Harrison D K,Leonard R.CAD/CAM and DNC links as a strategy formanufacture: implications for CAPM[J].Computing & Control Engineering Journal,1992(3):82-87.

[4] YAN Weiguo,WANG Minjie,WANG Minrui. Research of the Ethernet communication technology based on Ethernet and TCP/IP[J]. Journal of Da Lian University of Technology,2003,43(1):77-81.

[5] Jean J. Labrosse. μC/OS-II-Open source real-time embedded operating system[M].Bei Jing:China electric power press,2001.

DNC系統(tǒng)嵌入式串口服務(wù)器的研究與開發(fā)

曲寶軍*,郭 超

山東理工大學(xué) 機(jī)械工程學(xué)院,山東 淄博 255049

針對當(dāng)前使用的通用串口服務(wù)器在數(shù)控加工中出現(xiàn)的一些問題,提出了適用于DNC系統(tǒng)的數(shù)據(jù)傳輸機(jī)制,并論述了一種專用于DNC系統(tǒng)的嵌入式串口服務(wù)器的軟、硬件設(shè)計方法。研究了串口服務(wù)器的體系結(jié)構(gòu)以及內(nèi)核設(shè)計,提出了多任務(wù)內(nèi)核的具體實現(xiàn)方法。

串口服務(wù)器;DNC系統(tǒng);μC/OS-II;以太網(wǎng)

TP23

2013-01-09

*QU Baojun. E-mail:qbj22@sina.com

10.3969/j.issn.1001-3881.2013.06.007

猜你喜歡
山東理工大學(xué)多任務(wù)內(nèi)核
山東理工大學(xué)
萬物皆可IP的時代,我們當(dāng)夯實的IP內(nèi)核是什么?
山東理工大學(xué)
強(qiáng)化『高新』內(nèi)核 打造農(nóng)業(yè)『硅谷』
基于中心化自動加權(quán)多任務(wù)學(xué)習(xí)的早期輕度認(rèn)知障礙診斷
山東理工大學(xué)
基于嵌入式Linux內(nèi)核的自恢復(fù)設(shè)計
Linux內(nèi)核mmap保護(hù)機(jī)制研究
山東理工大學(xué)
基于判別性局部聯(lián)合稀疏模型的多任務(wù)跟蹤
宁河县| 宁乡县| 湘潭县| 顺平县| 迭部县| 乌什县| 乌鲁木齐市| 中超| 江北区| 织金县| 海城市| 山阴县| 青海省| 呼玛县| 澄迈县| 杭锦旗| 奉贤区| 老河口市| 阿勒泰市| 繁昌县| 萨嘎县| 克山县| 淮南市| 乐安县| 石城县| 滨州市| 青阳县| 荃湾区| 女性| 南川市| 威海市| 苍南县| 准格尔旗| 新晃| 铜山县| 琼海市| 安远县| 淳化县| 微博| 齐齐哈尔市| 泸西县|