Implementation of wireless communication and real time control for CNC system of embedded CNC turret punch press*

2014-06-09 14:44WeiweiLINPeisiZHONGXiaodongLYUXuanGE
机床与液压 2014年3期
关键词:嵌入式操作系统转塔实时控制

Wei-wei LIN,Pei-si ZHONG,Xiao-dong LYU,Xuan GE

Advanced Manufacturing Technology Center,Shandong University of Science and Technology,Qingdao 266590,China

Implementation of wireless communication and real time control for CNC system of embedded CNC turret punch press*

Wei-wei LIN†,Pei-si ZHONG,Xiao-dong LYU,Xuan GE

Advanced Manufacturing Technology Center,Shandong University of Science and Technology,Qingdao 266590,China

In view of the existing problems of CNC system,which is based on PC and widely used in the industry,this paper puts forward a high real time performance and multi task embedded CNC turret punch press system based on embedded technology and a microprocessor.In order to meet the requirements for the real-time control of CNC turret punch press,WinCE7 embedded operation system and the hardware platform based on CORTEXA8 microprocessor and FPGA are selected.The current situation of communication between computer and NC machine tool and its impact for the high efficient processing automation are analyzed,and the wire less communication scheme based on ZigBee of CNC turret punch press is proposed in this paper.The implementation of real-time control of CNC system is introduced and the experimental results show that the ZigBee module could realize normal communication between PC and embedded controller,data interaction and low business costs,and it could im prove production efficiency as well.

WinCE7,Embedded NC system,ZigBee,Wireless communication,Real-time control

1.Introduction

The numerical control technology is the core of advanced manufacturing technology,which is conducive to the development of high-tech industries and emerging cutting-edge industries[1].CNC system,the important equipment in manufacturing system,is the core of numerical control technology.Since the embedded numerical control system based on microprocessor is the perfect combination of embedded technology and numerical control technology,it has the following advantages:it could be customized,small volume,low power consumption,low cost,short development cycle,both hardware and software could be cut,good operation stability,and high reliability.Therefore,the scheme of CNC system embedded of CNC turret punch press,which is based on WinCE7,is proposed.

Since the open CNC system with high speed,high precision,efficient,intelligent and network has become the main trend for the development of contemporary numerical control system[2],the high real-time processing of the numerical control system for all kinds of parameters and file information are particularly important for the communication efficiency of NC system.The design uses the emerging industrial grade wireless communication scheme.

2.CNC system of embedded CNC turret punch press

2.1.CNC system architecture of em bedded CNC turret punch press

The hardware structure of CNC turret punchpress system is shown in Figure 1.

Figure 1.Hardware structure of the system

The whole system has five main components:PC subsystem,ZigBee wireless subsystem,ARM subsystem,D/A subsystem,and FPGA subsystem.PC subsystem is mainly to complete the coarse interpolation calculation.ZigBee wireless subsystem is responsible for the data exchange between the host computer and the machine tool controller.ARM microprocessor is responsible for receiving the PC rough interpolation processing data stream by the ZigBee wireless module and transmit data stream to the FPGA through the SPI bus.The D/A subsystem can meet the switch from digital signal to analog signal.The main function of FPGA is to complete the fine interpolation calculation produce the pulse signal to directly drive the movement of stepper motor[3].Stepper motors and stepper motor drivers constitute a stepper motor drive system.

2.2.Selection and construction of the system software platform

Windows Embedded Compact7(WinCE7)not only supports X86 and MIPS,but also supports the new ARMv7 framework and multi-core processors. Platform Builder 2008 seamlessly integrated in Visual Studio 2008,can provide a more efficient and smooth development experience for the developer[4]. Therefore,the new generation of operating system(Windows Embedded Compact 7)is chosed as the development platform of software system.

Windows Embedded Compact7 development environment sets up through Microsoft official online installation package.The operating system provides a wealth of tools and techniques which could help developers build rich and vivid equipment user interface and improve the application of high efficiency.However,these lead to installation requires a larger disk space.If all the installation components are selected in the process,the size of cache for installation will reach up to nearly 60 GB.Fortunately,a lot of component functions for different development are not needed,In order to save the disk space of PC and ensure the operation rate,it should make a concrete analysis for specific problems and select the useful components for the development.For example,since the development language is the VC++,the VC++ could be only installed when one starts to install VS2008 rather than C#and JAVA.Moreover,the corresponding processor should be selected to set up Platform Builder based on the design of hardware platform,such as the hardware platform for this design is Cortex-A8 microprocessor platform based on ARMv7 architecture specification compliance,and once it is installed,the"ARMv7 Architecture"becomes the only option.Therefore,by doing this,it could save time and avoid the waste of a large amount of disk space during installation.According to the corresponding hardware platform selects and customizes development component.After installation,it takes up about 35G of disk space.The steps for the Windows Embedded Compact7 development environment are as follows:(1)Visual Studio2008(2)MSDN Library for Visual Studio 2008(3)Visual Studio 2008 SP1(4)Microsoft Expression Blend(5)Windows Embedded Compact7(6)Microsoft Virtual PC

Once the above steps are completed,the embedded NC system development environment has been built.The next step is to transplant the customized operating system to the development board.By using USB line to download mirror finishing transplantation.Transplantation mainly needs three steps:①U-sing the EBOOT of original CE6 to burn the STEPLDR and EBOOT for CE7.②Run CE7 EBOOT and enter the‘F’command.③Using EBOOT of CE7 to download CE7 NK by USB line. After transplantation,the start interface of the development board is shown in Figure 2.

Figure 2.Development board boot interface

3.Realization of wireless communication for CNC turret punch press

ZigBee wireless network technology,low power consumption,easy configuration,get more and more widely used in the industry,is used in this design. In order to realize the wireless communication of NC system,ZigBee driven development becomes particularly important.

The machine equipment driver of embedded operating system is suitable for equipments integrated into the WinCE platform,such as LED and power supply.WinCE supports native device driver by customizing the interface,developers do not need to write device drivers.Stream interface drivers are the most common type of drivers implemented in Windows Embedded Compact 7[5].Stream interface driver program is designed to connect the WinCE platform’s peripheral equipment[6].Therefore,the ZigBee driver uses the stream interface driver.The main function of the drive is to send and receive data,network construction,adding network,acquiring RSSI and etc.The following will introduce several main stream interface functions for ZigBee driver.

1)DWORD CC2530_Init(DWORD dWContext)

RETAILMSG(l,(TEXT(“CC2530_Init---- n”)));

Serlnit();

CC2530init();

The function of this function is to initialize the module,enable the serial register and set the main parameters.Serlnit()function is to complete the physical address’s application,the virtual address to physical address mapping and setting baud rate. CC2530init()is to set the serial baud rate,stop bit and enabling register by calling the system serial transmission function.

2)BooL CC2530_IOControl(DWORD hopen-Context,DWORD dwCode,PBYTE PBufin,DWORD dwLenln,PBYTE PBufout,DWORD dwLenout,PDWORD PdwActualout)

{switch(dwCode)

case IO_CTL_CC2530_GDAIMA:

SendDate(0x l<<l);

case IO_CTL_CC2530_XITONGCANSHU:

SendDate(0x l<<2);

case IO_CTL_CC2530_DAOBUCANSHU:

SendDate(0xl<<3);

case IO_CTL_CC2530_RSSI:

SendDate(0xl<<4);

case IO_CTL_CC2530_REFNODE_

REQUEST_CONFIG:

SendDate(0xl<<23);

case IO_CTL_CC2530_REFNODE_

CONFIG:

SendDate(0xl<<21);

case IO_CTL_CC2530_BLINDNODE_

FIND_RESPONSE:

SendDate(0xl<<19);

case IO_CTL_CC2530_BLINDNODE_

REQUEST_CONFIG:

SendDate(0xl<<17);

case IO_CTL_CC2530_BLINDNODE_

CONFIG:

SendDate(0xl<<15);

case IO_CTL_CC2530_RSSI_BLAST:

SendDate(oxl<<13):

case IO_CTL_CC2530_RSSI_RESPONSE:

SendDate(0xl<<11):

This function is used to send commands to the device.DeviceIO Control()function can realize operating system to call this function.Parameter dw-Code is used to inform the driver to perform an action.In driver design,the definition of several simple commands such as G code,embedded NC system parameters,tool compensation parameters,RSSI value.The values are 1,2,3 and 4.When the CC2530 receives the application related to several orders,wireless modules begin to collect the related data in the network,and then sent them to the wireless module which is connected to the machine.

The sending and receiving data of wireless module is shown in Figure 3.

Figure 3.Data sending and receiving process

4.Implementation of real-time control of embedded CNC turret punch press

Although windows CE is a real-time operation system,it has the characteristics of multi task operation system.According to the characteristics of the operation system,the CNC system such as interpolation,position control and fault diagnosis by triggering interrupt are the real-time tasks.The graphic display,edit and management of machining program,PLC scanning,the system input/output,interpolation preprocessing(decoding,processing speed pretreatment,cutter compensation)and other weak real-time tasks are arranged running on the common thread of the operation system.Hard real-time tasks use priority preemptive scheduling.

The priority setting of main task of NC system is shown in the Table 1.

The main control thread continues to run until the CNC system software is exited and the priority should be the minimum.Edit thread can compile machining program on-line,its priority is higher than the main control thread setting to level 230.Time slice of thread is 5 ms.The thread of parameter setting can set and modify the parameters of the system. Its priority is at the same level with edit thread.Communication and networking thread also must run at the same time.It keeps the CNC system connecting with the industrial control network,the priority should be higher than the main control thread setting to 220.Time slice of thread is 3 ms.Scanning panel thread completes scan of some switch signal on panel.The priority of the thread is at the same level with communication and networking thread.Interpretation instruction and the thread of execution will be responsible for the interpretation and implementation of the NC code and start the interpolation control.Its priority is set to level 170.Time slice thread is 1ms.Online monitoring and diagnosis thread take responsibility for security in CNC machining,a higher priority than the other thread priority,which can be set to 160.Time slice is 1ms.The thread must have been running.This thread can realize real-time automatic diagnosis for servo drive control unit,external device and system device.High priority tasks will be priority scheduling,the same priority thread will be run according to the time slice rotation schedule.

Table 1.Priority setting of main task of NC system

5.Test and experiment of system

The experimental machine is Nanjing Huaxun Machinery Manufacturing Co.,Ltd.HPI-3047 CNC turret punch with production workshop environment. Packet Sniffer protocol analysis software,can analysis and decode information packets of each layer protocols such as PHY and MAC,display the error packet and access error.As shown in Figure 4,the Packet Sniffer software capture wireless communication data packets is adopted in this NC system.Figure 5 shows the ACK frame after received data.

Figure 4.Send packets

Figure 5.Accept the data ACK frame

The experimental results show that the design of ZigBee wireless communication module of Embedded CNC turret punch press could achieve data interaction between the host computer and the machine tool embedded controller.It could completely replace the traditional cable communication to reduce the cost and improve the efficiency of machine tool.

6.Conclusion

In this paper,the WinCE7 real-time operating system and high performance microprocessor(CORTEXA8)are adopted to build the platform of NC system with high real-time and the implementation of real-time control systems is analyzed.The ZigBee wireless communication technology could be applied to the communication system of CNC machine tools to replace the traditional cable communication,save working space and the communication system maintenance and repair costs.With the development of internet and wireless communication technology,the requirements of high performance CNC system in CNC machining and the embedded NC system will get better application and development.The wireless communication machine,efficient manufacturing and Networked manufacturing will also get faster development.This trend of development will reduce the cost of enterprises and improve the economic efficiency of enterprises.

[1] Zou Yu-xie.Research on the key technology of Embedded CNC system based on ARM processor[D].Shanghai:Shanghai Jiao Tong University,2007.

[2] Ji Guang-ming.Design and research of high performance CNC system based on OMAP3530[D].Nanjing:Nanjing University of Aeronautics&amp,2012.

[3] Lai Xiao-feng,Liu Jing-meng,Gu Tian-yu,et al.The motion control system based on PC and FPGA[J].The application of electronic technology,2011(4):130-132,141.

[4] Shao Ming,Li Guang-yang,Yang Hui-ling.Design of Embedded CNC system function module based on FPGA[J].Machine tool&hydraulics,2010,16:68 -71.

[5] Samuel Phung,David Jones.Professional Windows?Embedded Compact7[M].John Wiley&Sons,Inc,2011.

[6] Wilson Y J.Windows CE Device Driver Development. Dr.Dobb’s[J].Journal of Software Tools for Professional Programmer,1998.

嵌入式数控转塔冲床数控系统无线通信与实时控制的实现*

吝伟伟†,钟佩思,吕晓东,葛 旋

山东科技大学先进制造技术研究中心,青岛 266590

针对当前广泛使用的基于PC的数控系统存在的不足,提出一种基于嵌入式技术和微处理器的高实时性、多任务的嵌入式数控转塔冲床数控系统。为满足数控转塔冲床对实时控制的要求,嵌入式操作系统选用WinCE7,硬件平台由CORTEXA8微处理器和FPGA组合而成。分析了计算机与数控机床之间通信方式的现状和对高效加工自动化的影响,提出了基于ZigBee的数控转塔冲床无线通信方案并介绍了数控系统实时控制的实现。结果表明:ZigBee模块通信正常,能实现上位机与嵌入式控制器之间的数据收发,降低了企业成本,提高了生产效率。

WinCE7;嵌入式数控系统;ZigBee;无线通信;实时控制

TP274

10.3969/j.issn.1001-3881.2014.18.018

2014-04-21

*Project supported by the Shandong Province Natural Science Fund Project(ZR2011EEM014)

†Wei-wei LIN,E-mail:sklinwei@163.com

猜你喜欢
嵌入式操作系统转塔实时控制
光电转塔自动搜索跟踪监视低小慢目标控制方法
FPSO改装项目内部转塔系统及安装工艺
计算机嵌入式操作系统分析
基于LabVIEW微电网实验平台监控系统的设计与实现
探讨ERP系统环境下企业会计的实时控制
转塔刀架快速设计方法研究
基于嵌入式操作系统的工业采集板设计
应用服务型人才培养体系下的嵌入式操作系统教学改革探索
空间机器人的计算力矩实时控制方法
新型高效转塔的应用